package com.mjlf.mqserver.schedule;

import com.mjlf.mqserver.inter.ServerFactory;
import com.mjlf.mqserver.server.MessageServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @ClassName MessageSchedule
 * @Author mjlft
 * @Date 2020/2/19 14:22
 * @Version 1.0
 * @Description TODO
 */
@Component
public class MessageSchedule {



    @Autowired
    private MessageServer messageServer;

    @Scheduled(fixedDelay = 300)
    public void synMessage() throws Exception {
        messageServer.synMessage();
    }

    //同步服务，判断是否有服务失效了
    @Scheduled(fixedDelay = 3000)
    public void synServer() throws Exception {
        messageServer.synCustomerIndex();
    }
}
